<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <body>
	
        Warehouse inventory <?php echo $_GET['warehouse']."<br/>";?>
        <?php
        require_once("Includes/db.php");
		// presto changeo
        
        $warehouseID = icsDB::getInstance()->get_warehouse_id_by_name($_GET['warehouse']);
        if (!$warehouseID) {
            exit("The warehouse " .$_GET['warehouse']. " is not found. Please check the spelling and try again" );
        }
        ?>
     
        <table border="black">
            <tr>
                <th>Item</th>
                <th>QOH</th>        
                <th>cost</th>
            </tr>
         <?php
	/* modify here: change query */
            $result = icsDB::getInstance()->get_inventory_by_warehouse_id($wisherID);
            while ($row = mysqli_fetch_array($result)) {
                echo "<tr><td>" . htmlentities($row['iname']) . "</td>"; /* verify*/
                echo "<td>" . htmlentities($row['iqoh']) . "</td>\n";  /* verify*/
                echo "<td>" . htmlentities($row['icost']) . "</td></tr>\n";
            }
            mysqli_free_result($result);
            ?>
        </table>
    </body>
</html>